<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>电子回单</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="" name="description">
<meta content="" name="author">
<link href="${request.getContextPath()}/Public/assets/admin/css/css.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css"
	rel="stylesheet" type="text/css">

<link
	href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css"
	id="style_components" rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/plugins.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/layout.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css"
	rel="stylesheet" type="text/css" id="style_color">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/custom.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css"
	href="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.css" />
<link
	href="${request.getContextPath()}/Public/assets/admin/css/common.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/kkpager.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/fancybox/source/jquery.fancybox.css"
	rel="stylesheet" type="text/css" />
<link rel="shortcut icon"
	href="${request.getContextPath()}/Public/favicon.ico">

<!-- select2控件样式 -->
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/select2/select2.css"
	rel="stylesheet" type="text/css">

<!-- 时间插件 -->
<link
	href="${request.getContextPath()}/Public/js/jqueryUI/css/jquery-ui.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/js/jqueryUI/css/jquery-ui-timepicker-addon.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/js/jqueryUI/css/jquery.datetimepicker.css"
	rel="stylesheet" type="text/css">
	
<script>
	BASE_URL = '${request.getContextPath()}'
</script>
<style type="text/css">

.nav> li > a {
    text-shadow: none;
    color: red;
    font-size: 22px;
}
.datepicker {
	font-size: 16px;
}

.datepicker td, .datepicker th {
	width: 14.28571428571429%;
	height: 40px;
}

.table-condensed {
	width: 100%;
}

.datepicker-inline {
	width: 100%;
}

.col-md-4, .col-md-6, .col-md-7, .col-md-12 {
	padding-right: 0px;
	padding-left: 0px;
}

.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
	.table>thead>tr>td, .table>thead>tr>th {
	border-bottom: 1px solid #ddd;
}
.input-inline {
    display: inline-block;
    width: 300px;
    vertical-align: middle;
}
.page a:link {color: blue}     /* 未被访问的链接     蓝色 */
.page a:visited {color: blue}  /* 已被访问过的链接   蓝色 */
.page a:hover {color: red}    /* 鼠标悬浮在上的链接 蓝色 */
.page a:active {color: blue}   /* 鼠标点中激活链接   蓝色 */


</style>

</head>
<body class="page-header-top-fixed page-footer-fixed">
	<!--头部信息结束 -->
	<div class="page-header">
		<!--头部开始-->
		<#include "/include/top.html" />
		<!-- 头部信息结束 -->
	</div>
	
	<!-- BEGIN PAGE CONTAINER -->
	<div class="page-container">
		<#include "/include/menu.html" />
		<div class="page-content-wrapper">
			<div class="page-content">
				<div class="container-fluid">
					<div class="row">
					<div class="col-md-12">
						<div class="portlet light " style="margin-top: 5px;">
							<div class="portlet-body">
									<div class="row" style="height: 56px; text-align:left ;padding-left: 3px;">
										<div class="col-sm-12">
											<div id="sample_2_filter" class="dataTables_filter">
												<form action="${request.getContextPath()}/electric/electric.do" method="post" id="myForm">
												<input type="hidden"  name="num" value="${num!}">
													<label>企业名称:<input type="text" class="form-control input-small2  input-inline" placeholder="企业名称" name="userId" id="userId" value="${userIds!''}">
													<label>企业邮箱:<input type="search" class="form-control input-small2  input-inline" placeholder="企业邮箱" name="userName" id="userName" value="${userName!''}">
													</label>
													<label>交易时间:<input type="search"
														class="form-control input-small2 input-inline inTimePicker"
														placeholder="开始时间" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"  name="startTime" id="startTime"
														value="${startTime!''}"
														>
													</label> - 
													<label><input type="search"
														class="form-control input-small2 input-inline inTimePicker"
														placeholder="结束时间" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"  name="endTime" id="endTime"
														value="${endTime!''}"
														>
													</label>
													<input type="hidden" value="" name="userIds" id="userIds">
													<button  class="btn red"  type="button" onclick="frmSubmit(0)">
														<i class="fa fa-search"></i> 查询
													</button>
													<button   class="btn red"  type="button" onclick="doPrint()">
														<i class="fa fa-print"></i> 打印
													</button>
												</form>
											</div>
										</div>
									</div>
									<table class="table table-striped table-bordered table-hover">
									<thead>
									<tr>
										<th>
											交易时间
										</th>
										<th>
											 交易编号
										</th>
										<th>
											交易类型
										</th>
										<th>
											摘要
										</th>
										<th>
											交易对方
										</th>
										<th>
											对方账号
										</th>
										<th>
											金额
										</th>
										<th>
											手续费
										</th>
										<th>
											当时余额
										</th>
										<th>
											打印校验码
										</th>
									</tr>
									</thead>
									<tbody>
										<#if tradeRecordList ??>
											<#list tradeRecordList as tradeRecord>
												<tr>
														<td>
															${tradeRecord.replayTime!'--'}
														</td>
														<td>
															${tradeRecord.trWaterId!'--'}
														</td>
														<td>
															${tradeRecord.trTypes!'--'}
														</td>
														<td>${tradeRecord.note!'--'}</td>
														<td>${tradeRecord.oppositCompanyName!'--'}</td>
														<td>${tradeRecord.otherAccountNo!'--'}</td>
														<td>${tradeRecord.trMoney!'--'}</td>
														<td>${tradeRecord.trCharge!'--'}</td>
														<td>${tradeRecord.userMoney!'--'}</td>
														<td>${tradeRecord.printCheckCode!'--'}</td>
												</tr>
											</#list>											
										</#if>
									</tbody>
									</table>
									 <div style="width:80%;margin:0 auto;">
										<div align="right" class="page">
										<#if num?? && num==1 >
										<a href="javaScript:frmSubmit(3)" style="" alt="下一页">上一页</a>
										
										<#else>
										<label ><a href="javaScript:frmSubmit(1)" alt="下一页">上一页</a></label>
										</#if>
										<#if listSize?? &&listSize < 10> 
										<a href="javaScript:frmSubmit(4)"  >下一页</a>										
										<#else>
										<a href="javaScript:frmSubmit(2)"  >下一页</a>
										 </#if>								
										</div>
									</div> 
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- END PAGE CONTAINER -->
	<!-- 底部开始 -->
	<#include "/include/foot.html" />
	<!-- 底部结束 -->
</body>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery.sparkline.min.js"
	type="text/javascript"></script>

<script
	src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker-index.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/fancybox/source/jquery.fancybox.pack.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/highcharts.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js"
	type="text/javascript"></script>
	
<script type="text/javascript"
	src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js"></script>

<!-- 时间格式转换 -->
<script src="${request.getContextPath()}/Public/js/moment/moment.js"
	type="text/javascript"></script>


<!-- select2控件 -->
<script type="text/javascript"
	src="${request.getContextPath()}/Public/assets/global/plugins/select2/select2.js"></script>
<script type="text/javascript"
	src="${request.getContextPath()}/Public/assets/global/plugins/select2/select2_locale_zh-CN.js"></script>

<!-- 时间插件 -->
<script
	src="${request.getContextPath()}/Public/js/jqueryUI/jquery.ui.custom.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/js/jqueryUI/jquery.ui.datepicker.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/js/jqueryUI/jquery.ui.datepicker-zh-CN.js"
	type="text/javascript"></script>

<!-- 脚本代码 -->
<script type="text/javascript">
	$(function() {
		Metronic.init(); // init metronic core componets
		Layout.init(); // init layout
		
		//搜索下拉框
		toSelect2();
		
		if($("#endTime").val() ==""){
			$("#endTime").datepicker("setDate", new Date());
			$("#startTime").datepicker("setDate",new Date());
		}
	});

	
	function toSelect2(){
		$("#userId").select2({// 
			   language: "zh_CN",
		       placeholder: "搜索仓库",//文本框的提示信息
		       minimumInputLength: 0,//至少输入n个字符，才去加载数据
		       allowClear: true, //是否允许用户清除文本信息
		       ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
		    	   url : "${request.getContextPath()}/accountAudit/queryUserAccountList.do",
		           dataType: 'json',//接收的数据类型
		           type : "post",
		           data: function (term, page) {//在查询时向服务器端传输的数据
		               return {
		            	   companyName:term, //联动查询的字符
		                   page: 10 //一次性加载的数据条数
		               };
		           },
		           results: function (data, page) { // parse the results into the format expected by Select2.
		               // since we are using custom formatting functions we do not need to alter remote JSON data
		               var realNames = new Array();    
		                    for (var i = 0; i < data.length; i++) {
		                         realNames.push({id: data[i].userId, text: data[i].companyName});
		                         
		                  }
		               return {results: realNames};
		           }
		       	},
		       	initSelection: function(element, callback) {//加载初始化
					var userId = $("#userId").val();
					if (userId != "") {
						$.ajax("${request.getContextPath()}/electric/queryCompanyById.do", {
							dataType: 'json',//接收的数据类型
				           	type : "post",
				           	data:{"userId":userId}
						}).done(function(data) { 
							callback({id:data.userId,text:data.companyName}); 
						});
					}
				},
		       	formatResult: resultFormatResult, // omitted for brevity, see the source of this page
		       	formatSelection: resultFormatSelection,  // omitted for brevity, see the source of this page
		       	dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller
		       	escapeMarkup: function (m) { return m; } // we do not want to escape markup since we are displaying html in results
		    });
		
	}
	
	
	function resultFormatResult(medata) {
        return medata.text; 
	} 
	      
	function resultFormatSelection(medata) {
		$("#userIds").val(medata.id);
	        return medata.text; 
	} 

	
	function AddDays(date){
		var nd = new Date(date);
		nd.setDate(nd.getDate()+36500);//最长间隔多少天  
		var y = nd.getFullYear();
		var m = nd.getMonth()+1;
		var d = nd.getDate();
		if(m <= 9) m = "0"+m;
		if(d <= 9) d = "0"+d; 
		var cdate = y+""+m+""+d;
		return cdate;
	}
	
	//打印 暂时设置为控制 键盘Ctrl+P 打印(二期做为服务器导出打印)
	function doPrint(){ 
		window.print();
    }  
	
	function frmSubmit(num){
		var  startTime=$("#startTime").val();
		var  endTime=$("#endTime").val();
		var  outnum=$("#num").val();
		if(num==0){
			$("#num").val(1);			
		}else if(num==1){//上一页
			$("#num").val(num-10);
		}else if(num==2){//上一页
			$("#num").val(num+10);
		}else if(num==3){//上一页
			alert("已经是第一页");
			return;
		}else if(num==4){//上一页
			alert("已经是最后一页");
			return;
		}
		if(startTime!=null&&startTime!=''&&endTime!=null&&endTime!=''){
			

			startTime = new Date(startTime.replace(/-/g, "/"));
			endTime= new Date(endTime.replace(/-/g, "/"));
			var days = startTime.getTime() - endTime.getTime();
			var time = parseInt(days / (1000 * 60 * 60 * 24));
			if(time>90||time<-90){
				alert("开始时间和结束相差不能超过三个月");
				return;
			}
		}	
		document.getElementById('myForm').submit();
		
		
	}
	
	
</script>
</html>